#ifndef _INPUT_H_
#define _INPUT_H_

#include <dinput.h>
#include "singleton.h"
#include "types.h"
#include "vector.h"

class input: public singleton<input>
{
public:
	input();
	~input();

	void init();

	void update();

	bool is_key		  (u8 key);
	bool is_mouse_key (u8 key);

	float  mouse_x();
	float  mouse_y();
	float  mouse_z();

private:
	HWND					m_hwnd;
	IDirectInput8*			m_dinput;
	IDirectInputDevice8*	m_keyboard;
	IDirectInputDevice8*	m_mouse;
	DIMOUSESTATE2			m_mouse_state;

	u8						m_keys[256];
	bool					m_keys_new[256];

	vector3					m_mouse_pos;
	vector3					m_mouse_border;

	bool					m_mouse_keys[8];
};

#endif